<?php 
	
?>
<div id='currentWallets'>
	<div class='wallet-top'>
		<span class='blue_vals'><strong><?php echo anchor('user/account/profile/wallets', 'Wallets and Currencies');?></strong></span>
	</div>
	<div>
		<ul id='currencyList'>
			<li>
				<?php foreach ($wallets as $key => $val):?>
					<h3><?php echo anchor("user/account/profile/wallet/" . $wallets[$key]['WALLET_CODE'],  $wallets[$key]['NAME']);?>  </h3>	
					<div class='wallet_code'><?php echo $wallets[$key]['WALLET_CODE']; ?> </div>	
					<ul>
					
						<?php
							$currencies = $wallets[$key]['currencies'];
							$balance = 0;
							foreach ($currencies as $ckey => $code):
						?>
							<li class='<?php echo $currencies[$ckey]['C_SYMBOL'];?>'>
							<span class='currency'>	 
								<?php echo $currencies[$ckey]['C_SYMBOL'];?>
							</span>
							<span class='value'>
								<?php 
									echo $currencies[$ckey]['C_SIGN'];
									echo "&nbsp;";
									$ammount = floor($currencies[$ckey]['AMMOUNT']);
									print $ammount;
								?>
								<span>
								<?php 
										$float_part = number_format($currencies[$ckey]['AMMOUNT'], 2, '.', '');
										$arr = explode(".", $float_part);
										$float_part = count($arr) > 1 ? $arr[1] : 0;
										echo "." . trim($float_part);
									?>
								</span>	
							</span>
							
						<?php endforeach;?>
					</ul>
				<?php endforeach;?>
				<span class='blue_vals'>
					
				<?php anchor('user/account/operations/deposit', 'Add Money');?>
				</span>	
			</li>
			
		</ul>
	</div>
	<div class="balance">
		Balance: <span class="value"><?php echo $cSign . " " .  $balance_ammount;?></span>
		<img width="18" height="19" title="Change Balance Currency" id="imgChangeBalance" src="<?php echo base_url();?>public/images/change_cur.png" alt="Change Currency" />
		&nbsp;&nbsp;
		<div class="user_info_gray">
<!--		/en/account/profile/limits.html-->
			<a style="color:#FFFFFF;" href="#">
				View limits
			</a>
		</div>
<!--		<a id="lnkHide" style="float:right; margin-top:-10px;" href="#">-->
<!--			<img src="<?php /*echo base_url();*/?>public/images/glasses.png" title="Hide/Show Money" alt="Hide/Show Money">-->
<!--		</a>-->
		<div style="clear:both;"></div>
</div>
</div>

<div id="changeBalanceCurrency" title="Change Balance Currency" style="display:none;" style="height: 230px; min-height: 100px; width: auto;" class="ui-dialog-content ui-widget-content">
	<div style="border:none;" class="form">
		<div id="errorDescription"></div>
		<form id="changeBCurrencyForm" method='post' action="<?php echo site_url("user/account/profile/change_balance")?>"  onsubmit="return Send('#changeBCurrencyForm');">
			<div class="line">
				<label id="Currencies" for="ddlCurrencies">Currency</label>
				<select id="ddlCurrencies" name="ddlCurrencies">
				<?php foreach ($av_currencies as $key => $val):?>
					<option value="<?php echo $val["ID"];?>"><?php echo $val["C_SYMBOL"];?></option>
				<?php endforeach;?>
				</select>
			</div>
			<div style='clear:both;'></div>
			<fieldset class="submit">
				<div class="input-button-block">
					<input type="submit" id="btnChangeBalance" value="Change Currency" name="btnChangeBalance">
				</div>
			</fieldset>
		</form>
	</div>
	<div id='loader' style='display:none;'>
		<img src='<?php echo base_url()?>public/images/loading.gif' alt='Loading...' />
	</div>
</div>